import request from '@/config/axios'

// 客户账单 VO
export interface CustomerBillVO {
  id: number // id
  priceId: number // price_id
  customerId: number // customer_id
  billDate: Date // 日期
  remark: string // 备注
  orderNo: string // 订单号
  companyName: string // 船公司名称
  companyCode: string // 船公司代码
  containerType: string // 柜型
  containerCount: number // 柜型数量
  shipFee: number // 船公司费
  dockFee: number // 码头费用
  serviceFee: number // 手续费
  totalFee: number // 总费用
  billStatus: number // 账单状态 1-待支付，2-已支付
  payTime: Date // 支付日期
}

// 客户账单 API
export const CustomerBillApi = {
  // 查询客户账单分页
  getCustomerBillPage: async (params: any) => {
    return await request.get({ url: `/crm/customer-bill/page`, params })
  },

  // 查询客户账单详情
  getCustomerBill: async (id: number) => {
    return await request.get({ url: `/crm/customer-bill/get?id=` + id })
  },

  // 新增客户账单
  createCustomerBill: async (data: CustomerBillVO) => {
    return await request.post({ url: `/crm/customer-bill/create`, data })
  },

  // 修改客户账单
  updateCustomerBill: async (data: CustomerBillVO) => {
    return await request.put({ url: `/crm/customer-bill/update`, data })
  },

  // 删除客户账单
  deleteCustomerBill: async (id: number) => {
    return await request.delete({ url: `/crm/customer-bill/delete?id=` + id })
  },

  // 导出客户账单 Excel
  exportCustomerBill: async (params) => {
    return await request.download({ url: `/crm/customer-bill/export-excel`, params })
  },
}